<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        html,
        body {
            width: 100%;
            height: 100%;
            /*让容器的宽度和高度都充满全屏*/
        }

        body {
            display: flex;
            background-color: pink;
            flex-direction: row;
            justify-content: center;
            align-items: center;

        }

        .heart {
            width: 200px;
            height: 200px;
            background-color: red;
            position: relative;
            transform: rotate(45deg);
            /*顺时针旋转45度*/
            animation: heart 1.5s  alternate infinite;
            box-shadow: 0 0 30px red;
        }

        .heart::before {
            content: '';
            width: 200px;
            height: 100px;
            background-color: red;
            position: absolute;
            left: 0px;
            top: -99px;
            border-radius: 100px 100px 0px 0px;
            box-shadow: 0 0 30px red;
        }

        .heart::after {
            content: '';

            width: 100px;
            height: 200px;
            background-color: red;
            position: absolute;
            left: -99px;
            top: 0px;
            border-radius: 100px 0px 0px 100px;
            box-shadow: 0 0 30px red;
        }

        @keyframes heart {
            from {
                transform: rotate(45deg) scale(0.6);
                /*scale缩放*/
            }

            to {
                transform: rotate(45deg) scale(1.2F);
                /*scale缩放*/
            }
        }
    </style>
</head>

<body>
    <div class="heart"></div>
    <p>跳动的心</p>
</body>

</html>